package com.scujj.cs6.model.vo;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer;
import com.scujj.cs6.config.MyLocalDateTimeDeserializer;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.time.LocalDateTime;

/**
 * @author FlanChan
 * @description 当地天气今日小时信息
 */
@Data
@Schema(name = "WeatherHoursVo", description = "当地天气今日视图对象")
public class WeatherHoursVo {
    @Schema(description = "天气现象")
    private String text;
    @Schema(description = "温度")
    private Integer temp;
    @Schema(description = "体感温度")
    @JsonProperty("feels_like")
    private Integer feelsLike;
    @Schema(description = "相对湿度")
    private Integer rh;
    @Schema(description = "风力等级")
    @JsonProperty("wind_class")
    private String windClass;
    @Schema(description = "风向描述")
    @JsonProperty("wind_dir")
    private String windDir;
    @Schema(description = "更新时间")
    @JsonProperty("uptime")
    @JsonFormat(pattern = "yyyyMMddHHmmss" , timezone = "GMT+8")
    @JsonSerialize(using = LocalDateTimeSerializer.class)
    @JsonDeserialize(using = MyLocalDateTimeDeserializer.class)
    private LocalDateTime updateTime;
}
